<template>
  <div class="header-box">
    <van-icon name="arrow-left" size=".24rem" style="margin-left: 0.1rem" />
    <h3>IN新年|口碑爆款</h3>
    <van-icon
      name="share-o"
      size=".24rem"
      style="margin-right: 0.1rem"
      @click="showShare = true"
    />
    <van-share-sheet
      v-model="showShare"
      title="立即分享给好友"
      :options="options"
      @select="onSelect"
    />
  </div>
</template>

<script>
import { Toast } from 'vant';
export default {
  name: "headerbaokuan",
  data() {
    return {
      showShare: false,
      options: [
        { name: "微信", icon: "wechat" },
        { name: "微博", icon: "weibo" },
        { name: "复制链接", icon: "link" },
        { name: "分享海报", icon: "poster" },
        { name: "二维码", icon: "qrcode" },
      ],
    };
  },
  methods: {
    onSelect(option) {
      Toast(option.name);
      this.showShare = false;
    },
  },
};
</script>

<style scoped>
.header-box {
  height: 0.54rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
